package websocket;

import org.springframework.messaging.simp.SimpMessagingTemplate;

public class WebSocketUtil {

	public static void pushMessage(SimpMessagingTemplate simpMessagingTemplate, String userId, Object message,
		String channel) {

		simpMessagingTemplate.convertAndSendToUser(userId, "/" + channel, message);
	}

	public static void pushMessageToAll(SimpMessagingTemplate simpMessagingTemplate, String message) {
		simpMessagingTemplate.convertAndSend("", message);
	}
}
